package com.lizard.schedule.ui.activity.view;

import android.content.Context;
import android.support.wearable.view.WearableListView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.lizard.schedule.R;

/**
 * Created by wangyiqian on 16/6/8.
 */

public class ScheduleItemView extends FrameLayout implements WearableListView.OnCenterProximityListener {

    private TextView time;

    private TextView content;

    private TextView finishedFlag;

    public ScheduleItemView(Context context) {
        this(context, null);
    }

    public ScheduleItemView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ScheduleItemView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        LayoutInflater.from(context).inflate(R.layout.schedule_list_item, this, true);
        time = (TextView) findViewById(R.id.time);
        content = (TextView) findViewById(R.id.content);
        finishedFlag = (TextView) findViewById(R.id.finished_flag);
    }

    @Override
    public void onCenterPosition(boolean b) {
        time.setTextSize(getResources().getDimension(R.dimen.schedule_item_time_center));
        content.setTextSize(getResources().getDimension(R.dimen.schedule_item_content_center));
        finishedFlag.setTextSize(getResources().getDimension(R.dimen.schedule_item_finish_flag_txt_center));
    }

    @Override
    public void onNonCenterPosition(boolean b) {
        time.setTextSize(getResources().getDimension(R.dimen.schedule_item_time));
        content.setTextSize(getResources().getDimension(R.dimen.schedule_item_content));
        finishedFlag.setTextSize(getResources().getDimension(R.dimen.schedule_item_finish_flag_txt));

    }
}
